<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>借贷管理系统</title>
    <meta name="keywords" content="借贷管理系统">
    <meta name="description" content="借贷管理系统">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="__PUBLIC__/admin/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">

    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">


    <!--<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/plugins/webuploader/webuploader.css">-->
    <!--<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/demo/webuploader-demo.css">-->
    <script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>

    <script src="__PUBLIC__/admin/js/plugins/summernote/summernote.min.js"></script>
    <script src="__PUBLIC__/admin/js/plugins/summernote/summernote-zh-CN.js"></script>


    <!--<script src="__PUBLIC__/admin/js/plugins/webuploader/webuploader.min.js"></script>-->

    <!--<script src="__PUBLIC__/admin/js/demo/webuploader-demo.js"></script>-->
    <!--&lt;!&ndash;<script src="__PUBLIC__/admin/js/demo/webuploader_file.js"></script>&ndash;&gt;-->

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>修改群名称</h5>
                </div>
                <div class="ibox-content" style="overflow: hidden">
                    <form role="form" class="form-horizontal" id="form1" method="post">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">群名称</label>
                                <div class="col-sm-4">
                                    <input type="text" id="group-name" name="name" class="form-control" placeholder="请输入群名称" value="{$info.name}" >
                                </div>
                            </div>
                            <div class="col-sm-12 col-sm-offset-3">
                                <input type="hidden" name="id" value="{$info.id}" id="submit-id">
                                <button class="btn btn-primary" type="button" id="submit">保存内容</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/Public/layui/layui.js"></script>
<script>
    layui.use(['layer'], function(){
        var layer = layui.layer;
        $('#submit').click(function () {
            var name = $('#group-name').val();
            var id = $('#submit-id').val();
            if (name === '') {
                layer.msg('群名称不能为空', {icon: 2});
            }

            var index = layer.load();
            $.ajax({
                type : "POST",
                url  : '/index.php/Admin/Group/index',
                data : {name: name,id: id},
                datatype : "json",
                success : function (res) {
                    layer.close(index);
                    if (res.status == 1) {
                        layer.msg(res.info, {icon: 1});
                    } else {
                        layer.msg(res.info, {icon: 2});
                    }
                },
                error: function(){
                    alert("程序错误!")
                }
            });
        })
    })

</script>

</body>

</html>



